package com.myzl.web.controller.visualization;

import com.myzl.coal.service.IAlarmEventService;
import com.myzl.coal.service.IDeviceService;
import com.myzl.coal.service.IMongoHistoryDataService;
import com.myzl.common.core.domain.AjaxResult;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @ClassName VisualizationControl
 * @Author wzb
 * @Date 2023/6/7 15:02
 * @Description
 */
@RestController
@Slf4j
@Data
@RequestMapping("/visualization/recognition/")
public class RecognitionController {
    private final IMongoHistoryDataService mongoHistoryDataService;
    private final IAlarmEventService alarmEventService;
    private final IDeviceService deviceService;

    @GetMapping("/proportion")
    public AjaxResult proportion(@RequestParam(defaultValue = "102") Integer deviceId) {
        Map<String, List<String>> stringListMap = mongoHistoryDataService.thirtyCoalProportion(deviceId);
        return AjaxResult.success(stringListMap);
    }

}
